Skip to content

Conversation

@amarziali
Copy link
Contributor

@amarziali amarziali commented Nov 3, 2025

What Does This Do

This PR introduces a set of queue implementations in order to replace the JCTools-based queues, eliminating direct usage of sun.misc.Unsafe and providing full compatibility with Java 9+ runtimes through the VarHandle API.

The goal is to achieve similar high-performance concurrent queue behavior as JCTools while using supported, standard Java mechanisms.

A new Queues factory class is introduced to dynamically select the optimal queue implementation based on the Java runtime environment:

  • On Java 9 and newer, the factory instantiates the new VarHandle-based queues
  • On Java 1.8, it falls back to the existing JCTools-based queues to maintain backward compatibility and performance consistency.

Introduced Classes Summary

Class Pattern Description
SpscArrayQueueVarHandle Single-Producer / Single-Consumer Lock-free SPSC queue using VarHandles with acquire/release semantics. When possible, eliminates redundant volatile reads via cached head and tail.
SpmcArrayQueueVarHandle Single-Producer / Multiple-Consumer Lock-free SPMC queue supporting concurrent consumers using atomic head updates (CAS). Uses consumerLimit caching to reduce volatile contention.
MpscArrayQueueVarHandle<E> Multiple-Producer / Single-Consumer Lock-free MPSC queue where producers claim slots via CAS on TAIL_HANDLE. Maintains a producerLimit to minimize volatile head reads.
MpscBlockingConsumerArrayQueueVarHandle<E> Multiple-Producer / Single-Consumer (Blocking) Extends MPSC with blocking consumer support. Uses CONSUMER_THREAD_HANDLE to park/unpark the waiting consumer efficiently.

Memory Padding

All queue state fields (head, tail, cached limits, etc.) are cache-line padded to prevent false sharing between producers and consumers.
This ensures that frequently accessed hot fields do not reside on the same cache line across threads, minimizing cache invalidations and improving throughput under contention.

Memory Fence Semantics

Memory fences were explicitly chosen for each access type to minimize volatile overhead while maintaining correct visibility guarantees:

  • setRelease / getAcquire for publishing and consuming elements — provides correct inter-thread ordering without full barriers.
  • setOpaque / getOpaque for relaxed head/tail updates — avoids unnecessary synchronization costs where ordering is not required.
  • getVolatile only used when full memory fences are really required (e.g. refreshing limits to ensure visibility when the queue might be full or empty).

Queue Benchmark Results (ops/us)

Note: SPSC benchmark shows contentions on slow path (i.e. queue is full/queue is empty). This should less frequently happen in our case. Increasing the queue size (hence reducing the probability that's full) shows good performances.

MPSCBlockingConsumer Queue Benchmark (ops/us)

Implementation Capacity Total Consume Produce
JCTools 1024 41,149 30,661 10,488
VarHandle 1024 258,074 246,683 11,391
JCTools 65536 32,413 24,680 7,733
VarHandle 65536 224,982 217,498 7,485

MPSC Queue Benchmark (ops/us)

Implementation Capacity Total Consume Produce
JCTools 1024 41,784 31,070 10,715
VarHandle 1024 238,609 222,383 16,226
JCTools 65536 39,589 32,370 7,219
VarHandle 65536 262,729 250,627 12,102

SPSC Queue Benchmark (ops/us)

Implementation Capacity Total Consume Produce
JCTools 1024 259,418 129,694 129,724
VarHandle 1024 101,007 72,542 28,465
JCTools 65536 537,111 268,577 268,534
VarHandle 65536 353,161 191,188 161,973

Takeaways:

  • MPSC queues can be replaced with a VarHandle equivalent. In some cases, the new implementation shows even better performances.
  • jctools still outperforms in SPSC queues. Perhaps the VarHandle implementation might be optimised further.

Room for future improvements

In high-throughput scenarios where multiple producers compete for queue space, contention on the CAS operation can become a bottleneck.

Idea to mitigate this, when the queue is likely not full, a getAndAdd operation can be used instead of a CAS to claim slots since it will never fail. This optimization allows multiple producers to advance the tail index with reduced atomic contention. However, when the queue is nearly full, the getAndAdd cannot be reliably done hence the classic CAS loop (slow path) can be used instead.

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Nov 3, 2025

🎯 Code Coverage
Patch Coverage: 91.30%
Total Coverage: 59.61% (-0.00%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b2850b3 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@pr-commenter
Copy link

pr-commenter bot commented Nov 3, 2025

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1762350659 1762351004
end_time 2025-11-05T13:52:20 2025-11-05T13:58:05
git_branch master andrea.marziali/remove-jctools-queues
git_commit_sha 8db72c0 a880c67
start_time 2025-11-05T13:51:00 2025-11-05T13:56:45
See matching parameters
Baseline Candidate
ci_job_id 1217030429 1217030429
ci_pipeline_id 81317491 81317491
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
git_commit_date 1762349967 1762349967

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 5 unstable metrics.

See unchanged results
scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:noprobe unstable
[-16.952µs; +19.877µs] or [-6.074%; +7.122%]
unstable
[-27.156µs; +31.309µs] or [-8.553%; +9.861%]
unstable
[-36.996µs; +42.158µs] or [-11.187%; +12.748%]
unstable
[-142.099µs; +61.104µs] or [-13.747%; +5.911%]
same
scenario:basic same same same unstable
[-226.500µs; -8.890µs] or [-25.732%; -1.010%]
same
scenario:loop unsure
[+0.257µs; +4.484µs] or [+0.003%; +0.051%]
unsure
[-7.436µs; -0.629µs] or [-0.083%; -0.007%]
unsure
[-8.505µs; -0.543µs] or [-0.094%; -0.006%]
same same
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (317.508 µs) : 291, 344
.   : milestone, 318,
basic (294.053 µs) : 287, 301
.   : milestone, 294,
loop (8.959 ms) : 8956, 8963
.   : milestone, 8959,
section candidate
noprobe (319.585 µs) : 290, 349
.   : milestone, 320,
basic (293.196 µs) : 286, 300
.   : milestone, 293,
loop (8.955 ms) : 8952, 8958
.   : milestone, 8955,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 317.508 µs [291.339 µs, 343.677 µs]
basic 294.053 µs [286.681 µs, 301.425 µs]
loop 8.959 ms [8.956 ms, 8.963 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 319.585 µs [290.19 µs, 348.98 µs]
basic 293.196 µs [286.34 µs, 300.053 µs]
loop 8.955 ms [8.952 ms, 8.958 ms]

@pr-commenter
Copy link

pr-commenter bot commented Nov 3, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/remove-jctools-queues
git_commit_date 1762881452 1762791589
git_commit_sha 5db793a b2850b3
release_version 1.56.0-SNAPSHOT~5db793a092 1.56.0-SNAPSHOT~b2850b3848
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1762939764 1762939764
ci_job_id 1229208678 1229208678
ci_pipeline_id 82047900 82047900
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-q0peqr91 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-q0peqr91 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

Found 4 performance improvements and 2 performance regressions! Performance is the same for 50 metrics, 9 unstable metrics.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:startup:insecure-bank:iast:GlobalTracer better
[-8.359ms; -5.675ms] or [-3.554%; -2.413%]
228.180ms 235.197ms
scenario:startup:insecure-bank:iast:Remote Config better
[-36.816µs; -16.311µs] or [-6.069%; -2.689%]
580.017µs 606.581µs
scenario:startup:insecure-bank:tracing:GlobalTracer better
[-7.100ms; -5.558ms] or [-2.884%; -2.257%]
239.889ms 246.218ms
scenario:startup:insecure-bank:tracing:Remote Config better
[-44.846µs; -15.290µs] or [-6.225%; -2.122%]
690.347µs 720.415µs
scenario:startup:petclinic:appsec:Debugger worse
[+124.131µs; +294.718µs] or [+2.075%; +4.927%]
6.191ms 5.982ms
scenario:startup:petclinic:appsec:Telemetry worse
[+198.339µs; +514.187µs] or [+2.322%; +6.020%]
8.897ms 8.541ms
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.56.0-SNAPSHOT~b2850b3848, baseline=1.56.0-SNAPSHOT~5db793a092

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.059 s) : 0, 1058740
Total [baseline] (10.867 s) : 0, 10866527
Agent [candidate] (1.043 s) : 0, 1043177
Total [candidate] (4.277 s) : 0, 4277211
section appsec
Agent [baseline] (1.223 s) : 0, 1222917
Total [baseline] (10.887 s) : 0, 10886742
Agent [candidate] (1.224 s) : 0, 1223637
Total [candidate] (10.929 s) : 0, 10928856
section iast
Agent [baseline] (1.179 s) : 0, 1179245
Total [baseline] (11.166 s) : 0, 11166079
Agent [candidate] (1.181 s) : 0, 1181262
Total [candidate] (11.235 s) : 0, 11235160
section profiling
Agent [baseline] (1.203 s) : 0, 1203412
Total [baseline] (10.852 s) : 0, 10851559
Agent [candidate] (1.194 s) : 0, 1194394
Total [candidate] (10.891 s) : 0, 10890996
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.059 s -
Agent appsec 1.223 s 164.177 ms (15.5%)
Agent iast 1.179 s 120.505 ms (11.4%)
Agent profiling 1.203 s 144.672 ms (13.7%)
Total tracing 10.867 s -
Total appsec 10.887 s 20.214 ms (0.2%)
Total iast 11.166 s 299.552 ms (2.8%)
Total profiling 10.852 s -14.968 ms (-0.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.043 s -
Agent appsec 1.224 s 180.461 ms (17.3%)
Agent iast 1.181 s 138.085 ms (13.2%)
Agent profiling 1.194 s 151.217 ms (14.5%)
Total tracing 4.277 s -
Total appsec 10.929 s 6.652 s (155.5%)
Total iast 11.235 s 6.958 s (162.7%)
Total profiling 10.891 s 6.614 s (154.6%)
gantt
    title petclinic - break down per module: candidate=1.56.0-SNAPSHOT~b2850b3848, baseline=1.56.0-SNAPSHOT~5db793a092

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.48 ms) : 0, 1480
crashtracking [candidate] (1.445 ms) : 0, 1445
BytebuddyAgent [baseline] (713.857 ms) : 0, 713857
BytebuddyAgent [candidate] (705.626 ms) : 0, 705626
GlobalTracer [baseline] (247.826 ms) : 0, 247826
GlobalTracer [candidate] (239.963 ms) : 0, 239963
AppSec [baseline] (32.587 ms) : 0, 32587
AppSec [candidate] (32.789 ms) : 0, 32789
Debugger [baseline] (6.466 ms) : 0, 6466
Debugger [candidate] (6.327 ms) : 0, 6327
Remote Config [baseline] (712.572 µs) : 0, 713
Remote Config [candidate] (697.274 µs) : 0, 697
Telemetry [baseline] (15.081 ms) : 0, 15081
Telemetry [candidate] (9.418 ms) : 0, 9418
Flare Poller [baseline] (5.767 ms) : 0, 5767
Flare Poller [candidate] (12.402 ms) : 0, 12402
section appsec
crashtracking [baseline] (1.461 ms) : 0, 1461
crashtracking [candidate] (1.46 ms) : 0, 1460
BytebuddyAgent [baseline] (729.65 ms) : 0, 729650
BytebuddyAgent [candidate] (733.206 ms) : 0, 733206
GlobalTracer [baseline] (238.051 ms) : 0, 238051
GlobalTracer [candidate] (233.694 ms) : 0, 233694
IAST [baseline] (24.728 ms) : 0, 24728
IAST [candidate] (25.06 ms) : 0, 25060
AppSec [baseline] (174.967 ms) : 0, 174967
AppSec [candidate] (175.181 ms) : 0, 175181
Debugger [baseline] (5.982 ms) : 0, 5982
Debugger [candidate] (6.191 ms) : 0, 6191
Remote Config [baseline] (655.024 µs) : 0, 655
Remote Config [candidate] (672.866 µs) : 0, 673
Telemetry [baseline] (8.541 ms) : 0, 8541
Telemetry [candidate] (8.897 ms) : 0, 8897
Flare Poller [baseline] (3.986 ms) : 0, 3986
Flare Poller [candidate] (4.121 ms) : 0, 4121
section iast
crashtracking [baseline] (1.454 ms) : 0, 1454
crashtracking [candidate] (1.469 ms) : 0, 1469
BytebuddyAgent [baseline] (827.554 ms) : 0, 827554
BytebuddyAgent [candidate] (832.83 ms) : 0, 832830
GlobalTracer [baseline] (234.764 ms) : 0, 234764
GlobalTracer [candidate] (230.839 ms) : 0, 230839
IAST [baseline] (31.572 ms) : 0, 31572
IAST [candidate] (33.789 ms) : 0, 33789
AppSec [baseline] (29.934 ms) : 0, 29934
AppSec [candidate] (28.3 ms) : 0, 28300
Debugger [baseline] (5.991 ms) : 0, 5991
Debugger [candidate] (6.02 ms) : 0, 6020
Remote Config [baseline] (591.414 µs) : 0, 591
Remote Config [candidate] (595.394 µs) : 0, 595
Telemetry [baseline] (8.46 ms) : 0, 8460
Telemetry [candidate] (8.351 ms) : 0, 8351
Flare Poller [baseline] (4.162 ms) : 0, 4162
Flare Poller [candidate] (4.139 ms) : 0, 4139
section profiling
crashtracking [baseline] (1.458 ms) : 0, 1458
crashtracking [candidate] (1.463 ms) : 0, 1463
BytebuddyAgent [baseline] (735.903 ms) : 0, 735903
BytebuddyAgent [candidate] (733.894 ms) : 0, 733894
GlobalTracer [baseline] (223.769 ms) : 0, 223769
GlobalTracer [candidate] (218.058 ms) : 0, 218058
AppSec [baseline] (32.439 ms) : 0, 32439
AppSec [candidate] (32.22 ms) : 0, 32220
Debugger [baseline] (7.601 ms) : 0, 7601
Debugger [candidate] (6.5 ms) : 0, 6500
Remote Config [baseline] (1.407 ms) : 0, 1407
Remote Config [candidate] (683.443 µs) : 0, 683
Telemetry [baseline] (14.601 ms) : 0, 14601
Telemetry [candidate] (16.252 ms) : 0, 16252
Flare Poller [baseline] (4.171 ms) : 0, 4171
Flare Poller [candidate] (4.118 ms) : 0, 4118
ProfilingAgent [baseline] (111.709 ms) : 0, 111709
ProfilingAgent [candidate] (110.834 ms) : 0, 110834
Profiling [baseline] (112.374 ms) : 0, 112374
Profiling [candidate] (111.469 ms) : 0, 111469
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.56.0-SNAPSHOT~b2850b3848, baseline=1.56.0-SNAPSHOT~5db793a092

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.049 s) : 0, 1049107
Total [baseline] (8.664 s) : 0, 8663597
Agent [candidate] (1.041 s) : 0, 1041300
Total [candidate] (8.657 s) : 0, 8656689
section iast
Agent [baseline] (1.181 s) : 0, 1181383
Total [baseline] (9.278 s) : 0, 9277927
Agent [candidate] (1.182 s) : 0, 1182254
Total [candidate] (9.277 s) : 0, 9276882
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.049 s -
Agent iast 1.181 s 132.276 ms (12.6%)
Total tracing 8.664 s -
Total iast 9.278 s 614.33 ms (7.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.041 s -
Agent iast 1.182 s 140.954 ms (13.5%)
Total tracing 8.657 s -
Total iast 9.277 s 620.193 ms (7.2%)
gantt
    title insecure-bank - break down per module: candidate=1.56.0-SNAPSHOT~b2850b3848, baseline=1.56.0-SNAPSHOT~5db793a092

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.46 ms) : 0, 1460
crashtracking [candidate] (1.459 ms) : 0, 1459
BytebuddyAgent [baseline] (706.057 ms) : 0, 706057
BytebuddyAgent [candidate] (704.649 ms) : 0, 704649
GlobalTracer [baseline] (246.218 ms) : 0, 246218
GlobalTracer [candidate] (239.889 ms) : 0, 239889
AppSec [baseline] (32.536 ms) : 0, 32536
AppSec [candidate] (32.545 ms) : 0, 32545
Debugger [baseline] (6.439 ms) : 0, 6439
Debugger [candidate] (6.323 ms) : 0, 6323
Remote Config [baseline] (720.415 µs) : 0, 720
Remote Config [candidate] (690.347 µs) : 0, 690
Telemetry [baseline] (13.697 ms) : 0, 13697
Telemetry [candidate] (10.922 ms) : 0, 10922
Flare Poller [baseline] (7.228 ms) : 0, 7228
Flare Poller [candidate] (10.171 ms) : 0, 10171
section iast
crashtracking [baseline] (1.465 ms) : 0, 1465
crashtracking [candidate] (1.502 ms) : 0, 1502
BytebuddyAgent [baseline] (829.268 ms) : 0, 829268
BytebuddyAgent [candidate] (836.861 ms) : 0, 836861
GlobalTracer [baseline] (235.197 ms) : 0, 235197
GlobalTracer [candidate] (228.18 ms) : 0, 228180
AppSec [baseline] (27.897 ms) : 0, 27897
AppSec [candidate] (29.007 ms) : 0, 29007
Debugger [baseline] (6.083 ms) : 0, 6083
Debugger [candidate] (5.965 ms) : 0, 5965
Remote Config [baseline] (606.581 µs) : 0, 607
Remote Config [candidate] (580.017 µs) : 0, 580
Telemetry [baseline] (8.469 ms) : 0, 8469
Telemetry [candidate] (8.407 ms) : 0, 8407
Flare Poller [baseline] (4.14 ms) : 0, 4140
Flare Poller [candidate] (4.057 ms) : 0, 4057
IAST [baseline] (33.369 ms) : 0, 33369
IAST [candidate] (32.571 ms) : 0, 32571
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/remove-jctools-queues
git_commit_date 1762881452 1762791589
git_commit_sha 5db793a b2850b3
release_version 1.56.0-SNAPSHOT~5db793a092 1.56.0-SNAPSHOT~b2850b3848
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1762940458 1762940458
ci_job_id 1229208679 1229208679
ci_pipeline_id 82047900 82047900
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-1-qryx5niw 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-1-qryx5niw 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 4 performance improvements and 0 performance regressions! Performance is the same for 16 metrics, 16 unstable metrics.

scenario Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p95 Δ mean throughput candidate mean agg_http_req_duration_p50 candidate mean agg_http_req_duration_p95 candidate mean throughput baseline mean agg_http_req_duration_p50 baseline mean agg_http_req_duration_p95 baseline mean throughput
scenario:load:insecure-bank:iast:high_load better
[-186.988µs; -68.578µs] or [-7.505%; -2.752%]
better
[-586.807µs; -171.865µs] or [-7.900%; -2.314%]
unstable
[-100.290op/s; +216.165op/s] or [-7.011%; +15.112%]
2.364ms 7.049ms 1488.375op/s 2.491ms 7.428ms 1430.438op/s
scenario:load:petclinic:profiling:high_load better
[-2.179ms; -1.239ms] or [-11.066%; -6.294%]
better
[-2.612ms; -0.676ms] or [-8.308%; -2.151%]
unstable
[-9.484op/s; +44.672op/s] or [-4.054%; +19.093%]
17.981ms 29.793ms 251.562op/s 19.690ms 31.437ms 233.969op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~b2850b3848, baseline=1.56.0-SNAPSHOT~5db793a092
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.179 ms) : 1167, 1190
.   : milestone, 1179,
iast (3.198 ms) : 3158, 3238
.   : milestone, 3198,
iast_FULL (5.595 ms) : 5539, 5650
.   : milestone, 5595,
iast_GLOBAL (3.649 ms) : 3588, 3710
.   : milestone, 3649,
profiling (2.091 ms) : 2071, 2110
.   : milestone, 2091,
tracing (1.807 ms) : 1792, 1823
.   : milestone, 1807,
section candidate
no_agent (1.2 ms) : 1188, 1212
.   : milestone, 1200,
iast (3.071 ms) : 3030, 3112
.   : milestone, 3071,
iast_FULL (5.672 ms) : 5615, 5730
.   : milestone, 5672,
iast_GLOBAL (3.507 ms) : 3456, 3559
.   : milestone, 3507,
profiling (2.136 ms) : 2117, 2155
.   : milestone, 2136,
tracing (1.761 ms) : 1748, 1775
.   : milestone, 1761,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.179 ms [1.167 ms, 1.19 ms] -
iast 3.198 ms [3.158 ms, 3.238 ms] 2.019 ms (171.3%)
iast_FULL 5.595 ms [5.539 ms, 5.65 ms] 4.416 ms (374.7%)
iast_GLOBAL 3.649 ms [3.588 ms, 3.71 ms] 2.47 ms (209.6%)
profiling 2.091 ms [2.071 ms, 2.11 ms] 912.103 µs (77.4%)
tracing 1.807 ms [1.792 ms, 1.823 ms] 628.696 µs (53.3%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.2 ms [1.188 ms, 1.212 ms] -
iast 3.071 ms [3.03 ms, 3.112 ms] 1.871 ms (155.9%)
iast_FULL 5.672 ms [5.615 ms, 5.73 ms] 4.472 ms (372.7%)
iast_GLOBAL 3.507 ms [3.456 ms, 3.559 ms] 2.307 ms (192.3%)
profiling 2.136 ms [2.117 ms, 2.155 ms] 935.666 µs (78.0%)
tracing 1.761 ms [1.748 ms, 1.775 ms] 561.054 µs (46.8%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.56.0-SNAPSHOT~b2850b3848, baseline=1.56.0-SNAPSHOT~5db793a092
    dateFormat X
    axisFormat %s
section baseline
no_agent (17.252 ms) : 17077, 17427
.   : milestone, 17252,
appsec (18.558 ms) : 18371, 18744
.   : milestone, 18558,
code_origins (17.479 ms) : 17302, 17656
.   : milestone, 17479,
iast (17.4 ms) : 17228, 17573
.   : milestone, 17400,
profiling (19.953 ms) : 19750, 20156
.   : milestone, 19953,
tracing (17.764 ms) : 17587, 17941
.   : milestone, 17764,
section candidate
no_agent (17.34 ms) : 17165, 17515
.   : milestone, 17340,
appsec (18.474 ms) : 18286, 18662
.   : milestone, 18474,
code_origins (17.629 ms) : 17455, 17802
.   : milestone, 17629,
iast (17.652 ms) : 17477, 17828
.   : milestone, 17652,
profiling (18.551 ms) : 18364, 18739
.   : milestone, 18551,
tracing (17.49 ms) : 17318, 17663
.   : milestone, 17490,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 17.252 ms [17.077 ms, 17.427 ms] -
appsec 18.558 ms [18.371 ms, 18.744 ms] 1.306 ms (7.6%)
code_origins 17.479 ms [17.302 ms, 17.656 ms] 226.611 µs (1.3%)
iast 17.4 ms [17.228 ms, 17.573 ms] 148.22 µs (0.9%)
profiling 19.953 ms [19.75 ms, 20.156 ms] 2.701 ms (15.7%)
tracing 17.764 ms [17.587 ms, 17.941 ms] 512.035 µs (3.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 17.34 ms [17.165 ms, 17.515 ms] -
appsec 18.474 ms [18.286 ms, 18.662 ms] 1.134 ms (6.5%)
code_origins 17.629 ms [17.455 ms, 17.802 ms] 288.637 µs (1.7%)
iast 17.652 ms [17.477 ms, 17.828 ms] 312.378 µs (1.8%)
profiling 18.551 ms [18.364 ms, 18.739 ms] 1.211 ms (7.0%)
tracing 17.49 ms [17.318 ms, 17.663 ms] 150.398 µs (0.9%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master andrea.marziali/remove-jctools-queues
git_commit_date 1762881452 1762791589
git_commit_sha 5db793a b2850b3
release_version 1.56.0-SNAPSHOT~5db793a092 1.56.0-SNAPSHOT~b2850b3848
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1762940102 1762940102
ci_job_id 1229208680 1229208680
ci_pipeline_id 82047900 82047900
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-6iyctisa 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-6iyctisa 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics.

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.56.0-SNAPSHOT~b2850b3848, baseline=1.56.0-SNAPSHOT~5db793a092
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.479 ms) : 1467, 1491
.   : milestone, 1479,
appsec (3.636 ms) : 3421, 3851
.   : milestone, 3636,
iast (2.215 ms) : 2151, 2279
.   : milestone, 2215,
iast_GLOBAL (2.252 ms) : 2188, 2316
.   : milestone, 2252,
profiling (2.076 ms) : 2023, 2129
.   : milestone, 2076,
tracing (2.029 ms) : 1980, 2079
.   : milestone, 2029,
section candidate
no_agent (1.478 ms) : 1467, 1490
.   : milestone, 1478,
appsec (3.691 ms) : 3470, 3911
.   : milestone, 3691,
iast (2.213 ms) : 2149, 2276
.   : milestone, 2213,
iast_GLOBAL (2.254 ms) : 2190, 2318
.   : milestone, 2254,
profiling (2.05 ms) : 1999, 2101
.   : milestone, 2050,
tracing (2.031 ms) : 1981, 2080
.   : milestone, 2031,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.479 ms [1.467 ms, 1.491 ms] -
appsec 3.636 ms [3.421 ms, 3.851 ms] 2.157 ms (145.9%)
iast 2.215 ms [2.151 ms, 2.279 ms] 736.109 µs (49.8%)
iast_GLOBAL 2.252 ms [2.188 ms, 2.316 ms] 772.966 µs (52.3%)
profiling 2.076 ms [2.023 ms, 2.129 ms] 597.086 µs (40.4%)
tracing 2.029 ms [1.98 ms, 2.079 ms] 550.279 µs (37.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.478 ms [1.467 ms, 1.49 ms] -
appsec 3.691 ms [3.47 ms, 3.911 ms] 2.212 ms (149.6%)
iast 2.213 ms [2.149 ms, 2.276 ms] 734.036 µs (49.6%)
iast_GLOBAL 2.254 ms [2.19 ms, 2.318 ms] 775.237 µs (52.4%)
profiling 2.05 ms [1.999 ms, 2.101 ms] 571.821 µs (38.7%)
tracing 2.031 ms [1.981 ms, 2.08 ms] 552.068 µs (37.3%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.56.0-SNAPSHOT~b2850b3848, baseline=1.56.0-SNAPSHOT~5db793a092
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.543 s) : 15543000, 15543000
.   : milestone, 15543000,
appsec (15.361 s) : 15361000, 15361000
.   : milestone, 15361000,
iast (18.788 s) : 18788000, 18788000
.   : milestone, 18788000,
iast_GLOBAL (18.011 s) : 18011000, 18011000
.   : milestone, 18011000,
profiling (14.931 s) : 14931000, 14931000
.   : milestone, 14931000,
tracing (14.745 s) : 14745000, 14745000
.   : milestone, 14745000,
section candidate
no_agent (15.515 s) : 15515000, 15515000
.   : milestone, 15515000,
appsec (14.953 s) : 14953000, 14953000
.   : milestone, 14953000,
iast (18.588 s) : 18588000, 18588000
.   : milestone, 18588000,
iast_GLOBAL (17.77 s) : 17770000, 17770000
.   : milestone, 17770000,
profiling (14.743 s) : 14743000, 14743000
.   : milestone, 14743000,
tracing (14.817 s) : 14817000, 14817000
.   : milestone, 14817000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.543 s [15.543 s, 15.543 s] -
appsec 15.361 s [15.361 s, 15.361 s] -182.0 ms (-1.2%)
iast 18.788 s [18.788 s, 18.788 s] 3.245 s (20.9%)
iast_GLOBAL 18.011 s [18.011 s, 18.011 s] 2.468 s (15.9%)
profiling 14.931 s [14.931 s, 14.931 s] -612.0 ms (-3.9%)
tracing 14.745 s [14.745 s, 14.745 s] -798.0 ms (-5.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.515 s [15.515 s, 15.515 s] -
appsec 14.953 s [14.953 s, 14.953 s] -562.0 ms (-3.6%)
iast 18.588 s [18.588 s, 18.588 s] 3.073 s (19.8%)
iast_GLOBAL 17.77 s [17.77 s, 17.77 s] 2.255 s (14.5%)
profiling 14.743 s [14.743 s, 14.743 s] -772.0 ms (-5.0%)
tracing 14.817 s [14.817 s, 14.817 s] -698.0 ms (-4.5%)

@amarziali amarziali force-pushed the andrea.marziali/remove-jctools-queues branch 6 times, most recently from 229f67a to 374d13d Compare November 7, 2025 14:59
@amarziali amarziali changed the title Removes jctools usage for lock-free queues. Replace JCTools queues with VarHandle-based implementations for Java 9+ Nov 10, 2025
@amarziali amarziali force-pushed the andrea.marziali/remove-jctools-queues branch from 2721d41 to 0a72587 Compare November 10, 2025 12:45
@amarziali amarziali force-pushed the andrea.marziali/remove-jctools-queues branch from 21e0a65 to 259eeb5 Compare November 10, 2025 15:25
@amarziali amarziali marked this pull request as ready for review November 10, 2025 16:20
@amarziali amarziali requested review from a team as code owners November 10, 2025 16:20
@amarziali amarziali requested a review from mcculls November 10, 2025 16:20
@github-actions
Copy link
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@amarziali amarziali requested a review from dougqh November 10, 2025 16:20
@amarziali amarziali added type: enhancement Enhancements and improvements comp: core Tracer core labels Nov 10, 2025
@amarziali amarziali force-pushed the andrea.marziali/remove-jctools-queues branch from 9e7acbe to b2850b3 Compare November 12, 2025 09:01
@franz1981
Copy link

Hi @amarziali I am one of the developers of JCTools and we are super happy if we could bring a var handle generation variant in our lib as well.
I can see the value and faster feedback/different ownership of having a stripped version of our dependency (which can still be obtain via shading actually...), but I believe would be a great community value if we could join efforts...plus, we love contributions ☺️

Note: JCTools is at the very core of other frameworks which will soon hit the "no unsafe world" JVM barrier, including Netty.
I'm recently working hard to improve it re this aspect, and JCtools is one of the key but missing pieces there too.
Which means that contributing to JCTools would bring an enormous value to Netty and to many others very impactful projects as well
🙏


// Padding to avoid false sharing
@SuppressWarnings("unused")
private long p0, p1, p2, p3, p4, p5, p6;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI the JVM is free to reorder fields, so to guarantee this padding you need to use an artificial class hierarchy that stops all the padding from being re-ordered to the end.

See https://sanjeev.pages.dev/false-sharing-cache-line-padding/#manualexplicit-padding-in-java

and the padded hierarchy in https://github.com/JCTools/JCTools/blob/master/jctools-core/src/main/java/org/jctools/queues/MpscBlockingConsumerArrayQueue.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants